package com.kingsoft.dc.khaos.module.mpp.sql;

import com.kingsoft.dc.khaos.module.mpp.client.MppClient;
import com.kingsoft.dc.khaos.module.mpp.exception.MppClientException;
import com.kingsoft.dc.khaos.plugin.core.KhaosContext;

/**
 * Created by jing on 19/8/2.
 */
public class MppSqlImpl extends SqlStrategy{

    @Override
    public Object execute(KhaosContext kc, String moduleId, MppSqlConfig config) {
        MppClient client = null;
        try {
            client = new MppClient(config, kc);
        client.execInsert(config.getSql());
        } catch (MppClientException e) {
            e.printStackTrace();
        } finally {
            if (client != null) {
                client.close();
            }
        }
        return null;
    }
}
